---
created:
  source_filename: /home/runner/work/mknodes/mknodes/.venv/lib/python3.14t/site-packages/anyenv/async_run.py
  source_function: run_sync.<locals>.wrapper
  source_line_no: 52
hide:
- toc
icon: ic:outline-tour
render_macros: true
title: A quick node tour
---

``` {.python }
def a_quick_tour(page: mk.MkPage) -> None:
```
This will be a quick, short random introduction of some of the nodes
included in **MkNodes**.
The selection of nodes is totally random, this should just provide a quick overview
how to interact with the nodes.

Let the tour begin!

Our first [MkNode][mknodes.MkNode] is very clever. You just show him a node and he
will tell you all you need to know about him.
It's [MkDocStrings][mknodes.MkDocStrings]!
Lets check what he knows about [MkPage][mknodes.MkPage]:
``` {.python }
    node = mk.MkDocStrings(mk.MkPage)
```
[MkDocStrings][mknodes.MkDocStrings] sometimes really writes long stories,
so we will put everything into
a collapsed [MkAdmonition][mknodes.MkAdmonition] box,
so we dont need that much space:
``` {.python }
    admonition = mk.MkAdmonition(node, collapsible=True)
    str(admonition)
```
Here is the result:
??? info
    ::: mknodes.MkPage


[MkDocStrings][mknodes.MkDocStrings] can even show information about himself.
Very talented!
``` {.python }
    node = mk.MkDocStrings(mk.MkDocStrings)
    admonition = mk.MkAdmonition(node, collapsible=True)
    str(admonition)
```
??? info
    ::: mknodes.MkDocStrings


Okay, that's enough DocStrings for today. You can find more of
[MkDocStrings][mknodes.MkDocStrings] work
in the API documentation, he will tell you something about every
[MkNode][mknodes.MkNode] there.

Another [MkNode][mknodes.MkNode] who is displaying his skills in the API docs is
[MkClassDiagram][mknodes.MkClassDiagram].

He's a very talented painter. Perhaps he can draw us something about
[MkPage][mknodes.MkPage]!

``` {.python }
    diagram = mk.MkClassDiagram(mk.MkPage)
    str(diagram)
```
``` mermaid
graph TD
  4460490528768["mkpage.MkPage"]
  4460482370560["mkcontainer.MkContainer"]
  4460482369536["mkcontainer.MkContainerBase"]
  4460482368512["mknode.MkNode"]
  140053153421568["builtins.object"]
  4460482370560 --> 4460490528768
  4460482369536 --> 4460482370560
  4460482368512 --> 4460482369536
  140053153421568 --> 4460482368512
```
[MkClassDiagram][mknodes.MkClassDiagram] can draw different kind of graphs.
The first picture [MkClassDiagram][mknodes.MkClassDiagram] has painted was about
base classes. Lets check out the subclasses:
``` {.python }
    diagram = mk.MkClassDiagram(mk.MkPage, mode="subclasses")
    str(diagram)
```
``` mermaid
graph TD
  4460490528768["mkpage.MkPage"]
  4460490549248["mktemplatepage.MkTemplatePage"]
  4460490550272["mkclasspage.MkClassPage"]
  4460490551296["mkmodulepage.MkModulePage"]
  4460490528768 --> 4460490549248
  4460490549248 --> 4460490550272
  4460490549248 --> 4460490551296
```
There are multiple talented drawers among the **MkNodes**.
[MkPipDepTree][mknodes.MkPipDepTree] is known for his dependency drawings,
we can ask him to draw a graph for one of our dependencies.

To not overboard him, lets pick a package without too many dependencies:
``` {.python }
    node_1 = mk.MkPipDepTree("gitpython", direction="LR")
    str(node_1)
```
``` mermaid
graph LR
    classDef missing stroke-dasharray: 5
    gitdb["gitdb\n4.0.12"]
    gitpython["GitPython\n3.1.46"]
    smmap["smmap\n5.0.2"]
    gitdb -- ">=3.0.1,<6" --> smmap
    gitpython -- ">=4.0.1,<5" --> gitdb

```
We now come to the last [MkNode][mknodes.MkNode] of our quick tour.

Let's introduce [MkMetadataBadges][mknodes.MkMetadataBadges]!

[MkMetadataBadges][mknodes.MkMetadataBadges] just loves Badges. He creates them
himself and doesnt rely on webservies.
``` {.python }
    node_2 = mk.MkMetadataBadges("classifiers", package="mkdocstrings")
    str(node_2)
```
<body><svg xmlns="http://www.w3.org/2000/svg" width="184" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_56">        <rect width="184" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_56)">        <path fill="#555" d="M0 0h57v20H0z"/>        <path fill="#4051b5" d="M57 0h127v20H57z"/>        <path fill="url(#b)" d="M0 0h184v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="29.5" y="15" fill="#010101" fill-opacity=".3">4 - Beta</text>        <text x="28.5" y="14">4 - Beta</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="121.5" y="15" fill="#010101" fill-opacity=".3">Development Status</text>        <text x="120.5" y="14">Development Status</text>    </g></svg></body>
<body><svg xmlns="http://www.w3.org/2000/svg" width="195" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_57">        <rect width="195" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_57)">        <path fill="#555" d="M0 0h76v20H0z"/>        <path fill="#4051b5" d="M76 0h119v20H76z"/>        <path fill="url(#b)" d="M0 0h195v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="39.0" y="15" fill="#010101" fill-opacity=".3">Developers</text>        <text x="38.0" y="14">Developers</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="136.5" y="15" fill="#010101" fill-opacity=".3">Intended Audience</text>        <text x="135.5" y="14">Intended Audience</text>    </g></svg></body>
<body><svg xmlns="http://www.w3.org/2000/svg" width="198" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_58">        <rect width="198" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_58)">        <path fill="#555" d="M0 0h50v20H0z"/>        <path fill="#4051b5" d="M50 0h148v20H50z"/>        <path fill="url(#b)" d="M0 0h198v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="26.0" y="15" fill="#010101" fill-opacity=".3">Python</text>        <text x="25.0" y="14">Python</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="125.0" y="15" fill="#010101" fill-opacity=".3">Programming Language</text>        <text x="124.0" y="14">Programming Language</text>    </g></svg></body>
<body><svg xmlns="http://www.w3.org/2000/svg" width="223" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_59">        <rect width="223" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_59)">        <path fill="#555" d="M0 0h75v20H0z"/>        <path fill="#4051b5" d="M75 0h148v20H75z"/>        <path fill="url(#b)" d="M0 0h223v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="38.5" y="15" fill="#010101" fill-opacity=".3">Python :: 3</text>        <text x="37.5" y="14">Python :: 3</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="150.0" y="15" fill="#010101" fill-opacity=".3">Programming Language</text>        <text x="149.0" y="14">Programming Language</text>    </g></svg></body>
<body><svg xmlns="http://www.w3.org/2000/svg" width="269" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_60">        <rect width="269" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_60)">        <path fill="#555" d="M0 0h121v20H0z"/>        <path fill="#4051b5" d="M121 0h148v20H121z"/>        <path fill="url(#b)" d="M0 0h269v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="61.5" y="15" fill="#010101" fill-opacity=".3">Python :: 3 :: Only</text>        <text x="60.5" y="14">Python :: 3 :: Only</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="196.0" y="15" fill="#010101" fill-opacity=".3">Programming Language</text>        <text x="195.0" y="14">Programming Language</text>    </g></svg></body>
<body><svg xmlns="http://www.w3.org/2000/svg" width="242" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_61">        <rect width="242" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_61)">        <path fill="#555" d="M0 0h94v20H0z"/>        <path fill="#4051b5" d="M94 0h148v20H94z"/>        <path fill="url(#b)" d="M0 0h242v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="48.0" y="15" fill="#010101" fill-opacity=".3">Python :: 3.10</text>        <text x="47.0" y="14">Python :: 3.10</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="169.0" y="15" fill="#010101" fill-opacity=".3">Programming Language</text>        <text x="168.0" y="14">Programming Language</text>    </g></svg></body>
<body><svg xmlns="http://www.w3.org/2000/svg" width="242" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_62">        <rect width="242" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_62)">        <path fill="#555" d="M0 0h94v20H0z"/>        <path fill="#4051b5" d="M94 0h148v20H94z"/>        <path fill="url(#b)" d="M0 0h242v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="48.0" y="15" fill="#010101" fill-opacity=".3">Python :: 3.11</text>        <text x="47.0" y="14">Python :: 3.11</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="169.0" y="15" fill="#010101" fill-opacity=".3">Programming Language</text>        <text x="168.0" y="14">Programming Language</text>    </g></svg></body>
<body><svg xmlns="http://www.w3.org/2000/svg" width="242" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_63">        <rect width="242" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_63)">        <path fill="#555" d="M0 0h94v20H0z"/>        <path fill="#4051b5" d="M94 0h148v20H94z"/>        <path fill="url(#b)" d="M0 0h242v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="48.0" y="15" fill="#010101" fill-opacity=".3">Python :: 3.12</text>        <text x="47.0" y="14">Python :: 3.12</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="169.0" y="15" fill="#010101" fill-opacity=".3">Programming Language</text>        <text x="168.0" y="14">Programming Language</text>    </g></svg></body>
<body><svg xmlns="http://www.w3.org/2000/svg" width="242" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_64">        <rect width="242" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_64)">        <path fill="#555" d="M0 0h94v20H0z"/>        <path fill="#4051b5" d="M94 0h148v20H94z"/>        <path fill="url(#b)" d="M0 0h242v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="48.0" y="15" fill="#010101" fill-opacity=".3">Python :: 3.13</text>        <text x="47.0" y="14">Python :: 3.13</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="169.0" y="15" fill="#010101" fill-opacity=".3">Programming Language</text>        <text x="168.0" y="14">Programming Language</text>    </g></svg></body>
<body><svg xmlns="http://www.w3.org/2000/svg" width="242" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_65">        <rect width="242" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_65)">        <path fill="#555" d="M0 0h94v20H0z"/>        <path fill="#4051b5" d="M94 0h148v20H94z"/>        <path fill="url(#b)" d="M0 0h242v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="48.0" y="15" fill="#010101" fill-opacity=".3">Python :: 3.14</text>        <text x="47.0" y="14">Python :: 3.14</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="169.0" y="15" fill="#010101" fill-opacity=".3">Programming Language</text>        <text x="168.0" y="14">Programming Language</text>    </g></svg></body>
<body><svg xmlns="http://www.w3.org/2000/svg" width="139" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_66">        <rect width="139" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_66)">        <path fill="#555" d="M0 0h97v20H0z"/>        <path fill="#4051b5" d="M97 0h42v20H97z"/>        <path fill="url(#b)" d="M0 0h139v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="49.5" y="15" fill="#010101" fill-opacity=".3">Documentation</text>        <text x="48.5" y="14">Documentation</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="119.0" y="15" fill="#010101" fill-opacity=".3">Topic</text>        <text x="118.0" y="14">Topic</text>    </g></svg></body>
<body><svg xmlns="http://www.w3.org/2000/svg" width="182" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_67">        <rect width="182" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_67)">        <path fill="#555" d="M0 0h140v20H0z"/>        <path fill="#4051b5" d="M140 0h42v20H140z"/>        <path fill="url(#b)" d="M0 0h182v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="71.0" y="15" fill="#010101" fill-opacity=".3">Software Development</text>        <text x="70.0" y="14">Software Development</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="162.0" y="15" fill="#010101" fill-opacity=".3">Topic</text>        <text x="161.0" y="14">Topic</text>    </g></svg></body>
<body><svg xmlns="http://www.w3.org/2000/svg" width="287" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_68">        <rect width="287" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_68)">        <path fill="#555" d="M0 0h245v20H0z"/>        <path fill="#4051b5" d="M245 0h42v20H245z"/>        <path fill="url(#b)" d="M0 0h287v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="123.5" y="15" fill="#010101" fill-opacity=".3">Software Development :: Documentation</text>        <text x="122.5" y="14">Software Development :: Documentation</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="267.0" y="15" fill="#010101" fill-opacity=".3">Topic</text>        <text x="266.0" y="14">Topic</text>    </g></svg></body>
<body><svg xmlns="http://www.w3.org/2000/svg" width="99" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_69">        <rect width="99" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_69)">        <path fill="#555" d="M0 0h57v20H0z"/>        <path fill="#4051b5" d="M57 0h42v20H57z"/>        <path fill="url(#b)" d="M0 0h99v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="29.5" y="15" fill="#010101" fill-opacity=".3">Utilities</text>        <text x="28.5" y="14">Utilities</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="79.0" y="15" fill="#010101" fill-opacity=".3">Topic</text>        <text x="78.0" y="14">Topic</text>    </g></svg></body>
<body><svg xmlns="http://www.w3.org/2000/svg" width="94" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_70">        <rect width="94" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_70)">        <path fill="#555" d="M0 0h45v20H0z"/>        <path fill="#4051b5" d="M45 0h49v20H45z"/>        <path fill="url(#b)" d="M0 0h94v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="23.5" y="15" fill="#010101" fill-opacity=".3">Typed</text>        <text x="22.5" y="14">Typed</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="70.5" y="15" fill="#010101" fill-opacity=".3">Typing</text>        <text x="69.5" y="14">Typing</text>    </g></svg></body>
Looks neat, right?
This is also a good chance to explain how nodes can get their information
from the context. Let me explain:

If we instanciate **MkNodes** and dont add them to the tree,
then the nodes are clueless. They dont know who they belong to.

To make them part of the tree, we either add them for example to a page

(like this: `page += node`)

or we pass them a parent on instantiation.

In this example, once we add [MkMetadataBadges][mknodes.MkMetadataBadges]
to the tree, that node knows
that he should create badges for our very own package, **mknodes**,
unless we explicitely tell him to do otherwise. It will become his new "default".

You dont believe me? Let me show you:
``` {.python }
    node_3 = mk.MkMetadataBadges("websites", parent=page)
```
Now that node is connected. If we ask him to draw now, he will create website
badges for **mknodes**!
``` {.python }
    str(node_3)
```
<body><a href='https://app.codecov.io/gh/phil65/mknodes'><svg xmlns="http://www.w3.org/2000/svg" width="198" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_16">        <rect width="198" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_16)">        <path fill="#555" d="M0 0h97v20H0z"/>        <path fill="#4051b5" d="M97 0h101v20H97z"/>        <path fill="url(#b)" d="M0 0h198v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="49.5" y="15" fill="#010101" fill-opacity=".3">Code coverage</text>        <text x="48.5" y="14">Code coverage</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="148.5" y="15" fill="#010101" fill-opacity=".3">app.codecov.io</text>        <text x="147.5" y="14">app.codecov.io</text>    </g></svg></a></body>
<body><a href='https://github.com/phil65/mknodes/discussions'><svg xmlns="http://www.w3.org/2000/svg" width="157" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_17">        <rect width="157" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_17)">        <path fill="#555" d="M0 0h81v20H0z"/>        <path fill="#4051b5" d="M81 0h76v20H81z"/>        <path fill="url(#b)" d="M0 0h157v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="41.5" y="15" fill="#010101" fill-opacity=".3">Discussions</text>        <text x="40.5" y="14">Discussions</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="120.0" y="15" fill="#010101" fill-opacity=".3">github.com</text>        <text x="119.0" y="14">github.com</text>    </g></svg></a></body>
<body><a href='https://phil65.github.io/mknodes/'><svg xmlns="http://www.w3.org/2000/svg" width="201" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_18">        <rect width="201" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_18)">        <path fill="#555" d="M0 0h97v20H0z"/>        <path fill="#4051b5" d="M97 0h104v20H97z"/>        <path fill="url(#b)" d="M0 0h201v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="49.5" y="15" fill="#010101" fill-opacity=".3">Documentation</text>        <text x="48.5" y="14">Documentation</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="150.0" y="15" fill="#010101" fill-opacity=".3">phil65.github.io</text>        <text x="149.0" y="14">phil65.github.io</text>    </g></svg></a></body>
<body><a href='https://github.com/phil65/mknodes/issues'><svg xmlns="http://www.w3.org/2000/svg" width="126" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_19">        <rect width="126" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_19)">        <path fill="#555" d="M0 0h50v20H0z"/>        <path fill="#4051b5" d="M50 0h76v20H50z"/>        <path fill="url(#b)" d="M0 0h126v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="26.0" y="15" fill="#010101" fill-opacity=".3">Issues</text>        <text x="25.0" y="14">Issues</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="89.0" y="15" fill="#010101" fill-opacity=".3">github.com</text>        <text x="88.0" y="14">github.com</text>    </g></svg></a></body>
<body><a href='https://github.com/phil65/mknodes'><svg xmlns="http://www.w3.org/2000/svg" width="127" height="20">    <linearGradient id="b" x2="0" y2="100%">        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>        <stop offset="1" stop-opacity=".1"/>    </linearGradient>    <mask id="anybadge_20">        <rect width="127" height="20" rx="3" fill="#fff"/>    </mask>    <g mask="url(#anybadge_20)">        <path fill="#555" d="M0 0h51v20H0z"/>        <path fill="#4051b5" d="M51 0h76v20H51z"/>        <path fill="url(#b)" d="M0 0h127v20H0z"/>    </g>    <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="26.5" y="15" fill="#010101" fill-opacity=".3">Source</text>        <text x="25.5" y="14">Source</text>    </g>    <g fill="#333333" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">        <text x="90.0" y="15" fill="#010101" fill-opacity=".3">github.com</text>        <text x="89.0" y="14">github.com</text>    </g></svg></a></body>
This mechanism is the same for many **MkNodes**. For example, our earlier guest
[MkPipDepTree][mknodes.MkPipDepTree] behaves the same. Once connected,
he will want to paint **mknodes** dependency graphs without us telling him to do so!

Interesting, right?

That's it for a first quick look at the nodes.
There are about 70 different ones available in this package.
Some are exciting, some are boring. It's no difference to humans.

Oh, and if you wonder how this tour was done: I got help from
[MkCommentedCode][mknodes.MkCommentedCode]!

``` {.python }
    page += mk.MkCommentedCode(a_quick_tour, style="text")
```
[MkCommentedCode][mknodes.MkCommentedCode] parses a function and separates comments
from code. These chunks are displayed on a rotating basis then.

Before we end the tour, let's take a look at the raw material.
We can use the [MkCode][mknodes.MkCode] node for that.

``` {.python }
    node_5 = mk.MkCode.for_object(a_quick_tour)
    text = str(node_5).replace(r"{", "<").replace(r"}", ">")
    page += text
```
As you can see, we added the [MkCode][mknodes.MkCode] node to the page.
It will be displayed right after the [MkCommentedCode][mknodes.MkCommentedCode]
block. You will see it right below.

Oh, and the String replacement you probably noticed is a quick hack to prevent
**jinja2** code from getting executed. YOu can ignore that, it's not relevant
 for this tour.

That's it. The rest of the nodes you need to check out yourself. Have fun!


``` <.python  title='mknodes.manual.a_quick_tour.a_quick_tour' linenums='4'>
def a_quick_tour(page: mk.MkPage) -> None:
    # This will be a quick, short random introduction of some of the nodes
    # included in **MkNodes**.
    # The selection of nodes is totally random, this should just provide a quick overview
    # how to interact with the nodes.
    #
    # Let the tour begin!
    #
    # Our first [MkNode][mknodes.MkNode] is very clever. You just show him a node and he
    # will tell you all you need to know about him.
    # It's [MkDocStrings][mknodes.MkDocStrings]!
    # Lets check what he knows about [MkPage][mknodes.MkPage]:
    node = mk.MkDocStrings(mk.MkPage)
    # [MkDocStrings][mknodes.MkDocStrings] sometimes really writes long stories,
    # so we will put everything into
    # a collapsed [MkAdmonition][mknodes.MkAdmonition] box,
    # so we dont need that much space:
    admonition = mk.MkAdmonition(node, collapsible=True)
    str(admonition)
    # Here is the result:
    # << "mknodes.MkPage" | MkDocStrings | MkAdmonition(collapsible=True) >>

    # [MkDocStrings][mknodes.MkDocStrings] can even show information about himself.
    # Very talented!
    node = mk.MkDocStrings(mk.MkDocStrings)
    admonition = mk.MkAdmonition(node, collapsible=True)
    str(admonition)
    # << "mknodes.MkDocStrings" | MkDocStrings | MkAdmonition(collapsible=True)>>

    # Okay, that's enough DocStrings for today. You can find more of
    # [MkDocStrings][mknodes.MkDocStrings] work
    # in the API documentation, he will tell you something about every
    # [MkNode][mknodes.MkNode] there.
    #
    # Another [MkNode][mknodes.MkNode] who is displaying his skills in the API docs is
    # [MkClassDiagram][mknodes.MkClassDiagram].
    #
    # He's a very talented painter. Perhaps he can draw us something about
    # [MkPage][mknodes.MkPage]!
    #
    diagram = mk.MkClassDiagram(mk.MkPage)
    str(diagram)
    # << "mknodes.MkPage" | MkClassDiagram >>

    # [MkClassDiagram][mknodes.MkClassDiagram] can draw different kind of graphs.
    # The first picture [MkClassDiagram][mknodes.MkClassDiagram] has painted was about
    # base classes. Lets check out the subclasses:
    diagram = mk.MkClassDiagram(mk.MkPage, mode="subclasses")
    str(diagram)
    # << "mknodes.MkPage" | MkClassDiagram(mode="subclasses") >>

    # There are multiple talented drawers among the **MkNodes**.
    # [MkPipDepTree][mknodes.MkPipDepTree] is known for his dependency drawings,
    # we can ask him to draw a graph for one of our dependencies.
    #
    # To not overboard him, lets pick a package without too many dependencies:

    node_1 = mk.MkPipDepTree("gitpython", direction="LR")
    str(node_1)
    # << "gitpython" | MkPipDepTree(direction="LR") >>

    # We now come to the last [MkNode][mknodes.MkNode] of our quick tour.
    #
    # Let's introduce [MkMetadataBadges][mknodes.MkMetadataBadges]!
    #
    # [MkMetadataBadges][mknodes.MkMetadataBadges] just loves Badges. He creates them
    # himself and doesnt rely on webservies.
    node_2 = mk.MkMetadataBadges("classifiers", package="mkdocstrings")
    str(node_2)
    # << "classifiers" | MkMetadataBadges(package="mkdocstrings") >>

    # Looks neat, right?
    # This is also a good chance to explain how nodes can get their information
    # from the context. Let me explain:
    #
    # If we instanciate **MkNodes** and dont add them to the tree,
    # then the nodes are clueless. They dont know who they belong to.
    #
    # To make them part of the tree, we either add them for example to a page
    #
    # (like this: `page += node`)
    #
    # or we pass them a parent on instantiation.
    #
    # In this example, once we add [MkMetadataBadges][mknodes.MkMetadataBadges]
    # to the tree, that node knows
    # that he should create badges for our very own package, **mknodes**,
    # unless we explicitely tell him to do otherwise. It will become his new "default".
    #
    # You dont believe me? Let me show you:
    node_3 = mk.MkMetadataBadges("websites", parent=page)

    # Now that node is connected. If we ask him to draw now, he will create website
    # badges for **mknodes**!

    str(node_3)
    # << "websites" | MkMetadataBadges >>

    # This mechanism is the same for many **MkNodes**. For example, our earlier guest
    # [MkPipDepTree][mknodes.MkPipDepTree] behaves the same. Once connected,
    # he will want to paint **mknodes** dependency graphs without us telling him to do so!
    #
    # Interesting, right?
    #
    # That's it for a first quick look at the nodes.
    # There are about 70 different ones available in this package.
    # Some are exciting, some are boring. It's no difference to humans.
    #
    # Oh, and if you wonder how this tour was done: I got help from
    # [MkCommentedCode][mknodes.MkCommentedCode]!
    #
    page += mk.MkCommentedCode(a_quick_tour, style="text")

    # [MkCommentedCode][mknodes.MkCommentedCode] parses a function and separates comments
    # from code. These chunks are displayed on a rotating basis then.
    #
    # Before we end the tour, let's take a look at the raw material.
    # We can use the [MkCode][mknodes.MkCode] node for that.
    #
    node_5 = mk.MkCode.for_object(a_quick_tour)
    text = str(node_5).replace(r"<", "<").replace(r">", ">")
    page += text
    # As you can see, we added the [MkCode][mknodes.MkCode] node to the page.
    # It will be displayed right after the [MkCommentedCode][mknodes.MkCommentedCode]
    # block. You will see it right below.
    #
    # Oh, and the String replacement you probably noticed is a quick hack to prevent
    # **jinja2** code from getting executed. YOu can ignore that, it's not relevant
    #  for this tour.
    #
    # That's it. The rest of the nodes you need to check out yourself. Have fun!

```